package encaps.utils.rendering;

import encaps.resources.Response;
import encaps.utils.html.HTML;
import encaps.utils.html.HTMLElement;
import org.jdom.Element;

public class TextMessageParser implements Parser {

    public TextMessageParser() {
    }

    @Override
    public HTMLElement renderToHTML(Element response) {
        Element message = response.getChild(Response.TEXT_MESSAGE);
        HTMLElement result = new HTMLElement(HTML.SPAN);
        result.addContent(message.getTextTrim());
        return result;
    }
}
